package main

import (
	"context"
	"fmt"
	"google.golang.org/grpc"
	"prototest/grpc_proto_test/proto-bak"
)

func main() {
	conn, err := grpc.Dial("127.0.0.1:8080", grpc.WithInsecure())
	if err != nil {
		panic(err)
	}
	defer conn.Close()

	client := proto_bak.NewGreeterClient(conn)
	reply, err := client.SayHello(context.Background(), &proto_bak.
		HelloRequest{
		Name: "lijinyan",
		Url:  "hanmoon.com",
		G:    proto_bak.Gender_MALE,
		Mp: map[string]string{
			"name":    "lijinyan",
			"company": "shopee",
		},
	})
	if err != nil {
		panic(err)
	}
	fmt.Println(reply.Message)
}
